package info.tsukaworld.gui;

import acm.graphics.GCompound;
import acm.graphics.GLabel;
import acm.graphics.GRect;
import java.awt.Font;
import info.tsukaworld.grid.Location;
import info.tsukaworld.actor.*;

public class BotHUD extends HUDComponent
{
    public static int BOT_HUD_HEIGHT = 80;
    private GLabel unit; 
    private GLabel terrain;
    
    public BotHUD()
    {
        add(new GRect(13 * 50,BOT_HUD_HEIGHT), 0, 690);
        add(new GRect(13 * 25,BOT_HUD_HEIGHT), 0, 690);
        unit = new GLabel("Unit Info: ");
        unit.setFont( new Font("Bold", Font.BOLD, 16 ));
        add( unit, 10, 720);
        
        terrain = new GLabel("Terrain info: ");
        terrain.setFont( new Font("Bold", Font.BOLD, 16 ));
        add( terrain, (PlayArea.MAX_WIDTH / 2) + 10, 720);
    }
    
    public void step()
    {
        Location loc = new Location(Game.mouseListener.getX()/50,  (Game.mouseListener.getY() - TopHUD.TOP_HUD_HEIGHT)/50);
        String name = "";
        if(  PlayArea.world.getGrid().isValid(loc) && PlayArea.world.getGrid().get(loc) != null)
        {
            name = PlayArea.world.getGrid().get(loc).getName();
        }
        terrain.setLabel("Terrain info: " + name);
    }
}